Access Cookbook by Ken Getz; Paul Litwin; Andy Baron

Access Cookbook by Ken Getz; Paul Litwin; Andy Baron

Author:Ken Getz; Paul Litwin; Andy Baron
Language: eng
Format: mobi
Tags: COMPUTERS / Database Management / General
ISBN: 9780596552527
Publisher: O'Reilly Media
Published: 2009-02-09T10:00:00+00:00


Tag

txtPhone

OnClick

=acbCarry([Form], [Screen].[ActiveControl])

Add the following function to a global module (or import basCarryForward from 09-05.MDB):

Public Function acbCarry(frm As Form, ctlToggle As Control)

Dim ctlData As Control

Const acbcQuote = """"

' The name of the data control this toggle control serves

' is stored in the toggle control's Tag property.

Set ctlData = frm(ctlToggle.Tag)

If ctlToggle.Value Then

' If the toggle button is depressed, place the current

' carry field control into the control's DefaultValue

' property. But first, store the existing DefaultValue,

' if any, in the control's Tag property.

If Len(ctlData.DefaultValue) > 0 Then

ctlData.Tag = ctlData.DefaultValue

End If

ctlData.DefaultValue = acbcQuote & ctlData.Value & acbcQuote

Else

' The toggle button is unpressed, so restore the text box's

' DefaultValue if there is a nonempty Tag property.

If Len(ctlData.Tag) > 0 Then

ctlData.DefaultValue = ctlData.Tag

ctlData.Tag = ""

Else

ctlData.DefaultValue = ""

End If

End If

End Function



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.